<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('【物品信息】列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>RFID编号：</label>
                                <input type="text" name="RFIDNO"/>
                            </li>
                            <li>
                                <label>物品分类：</label>
                                <input type="text" name="itemType"/>
                            </li>
                            <li>
                                <label>物品名称：</label>
                                <input type="text" name="itemName"/>
                            </li>
                            <li>
                                <label>物品品牌：</label>
                                <input type="text" name="itemBrand"/>
                            </li>
                            <li>
                                <label>规格型号：</label>
                                <input type="text" name="itemStandard"/>
                            </li>
                            <li>
                                <label>序列号：</label>
                                <input type="text" name="serialNumber"/>
                            </li>
                            <li>
                                <label>采购日期：</label>
                                <input type="text" class="time-input" placeholder="请选择采购日期" name="stockDate"/>
                            </li>
                            <li>
                                <label>责任部门：</label>
                                <input type="text" name="responsibleDept"/>
                            </li>
                            <li>
                                <label>责任人：</label>
                                <input type="text" name="responsibleEmp"/>
                            </li>
                            <li>
                                <label>使用部门：</label>
                                <input type="text" name="useDept"/>
                            </li>
                           <!-- <li>
                                <label>使用人：</label>
                                <input type="text" name="useEmp"/>
                            </li>-->
                          <!--  <li>
                                <label>供货商：</label>
                                <input type="text" name="provider"/>
                            </li>-->
                            <li>
                                <label>存放位置：</label>
                                <input type="text" name="storageLocation"/>
                            </li>
                          <!--  <li>
                                <label>物品状态：</label>
                                <select name="status">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>-->
                            <li>
                                <label>创建时间：</label>
                                <input type="text" class="time-input" placeholder="请选择创建时间" name="createTime"/>
                            </li>
                           <!-- <li>
                                <label>更新时间：</label>
                                <input type="text" class="time-input" placeholder="请选择更新时间" name="updateTime"/>
                            </li>-->
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:item:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:item:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:item:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:item:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:item:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:item:remove')}]];
        var prefix = ctx + "system/item";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "【物品信息】",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'rfidno',
                    title: 'RFID编号'
                },
                {
                    field: 'itemType',
                    title: '物品分类'
                },
                {
                    field: 'itemName',
                    title: '物品名称'
                },
                {
                    field: 'itemBrand',
                    title: '物品品牌'
                },
                {
                    field: 'itemStandard',
                    title: '规格型号'
                },
                {
                    field: 'serialNumber',
                    title: '序列号'
                },
                {
                    field: 'stockDate',
                    title: '采购日期'
                },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    field: 'responsibleDept',
                    title: '责任部门'
                },
                {
                    field: 'responsibleEmp',
                    title: '责任人'
                },
                {
                    field: 'useDept',
                    title: '使用部门'
                },
                {
                    field: 'useEmp',
                    title: '使用人'
                },
                {
                    field: 'provider',
                    title: '供货商'
                },
                {
                    field: 'storageLocation',
                    title: '存放位置'
                },
                {
                    field: 'status',
                    title: '物品状态',
                    formatter:function(value, row, index) {
                        if(value==1){
                            return "已登记"
                        }else if(value == 2){
                            return "申请中"
                        }
                    }
                },
                {
                    field: 'createTime',
                    title: '创建时间'
                },
                {
                    field: 'updateTime',
                    title: '更新时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>